<%@ page language="java" %>
<%@ page session="true" %>
<%@ page import="java.sql.*,java.io.*,java.util.Random"%>
 <% String userid = request.getParameter("userid");
 System.out.println(userid);
int auth=99;
String userr="";
userr = (session.getAttribute("userr")==null) ? "Null" : (String)session.getAttribute("userr"); 

if(userr.equals("Null"))
{
	session.invalidate();
	%>
	<!--<H5 align=center><IMG SRC="Images/error.gif" WIDTH="17" HEIGHT="13" BORDER=0 ALT="">Session time out...Please login again</H5>-->
	<script language=javascript>
		location.replace('sessiontimeout.html');
	</script>
	<% 
}else{
	Integer IAuth =(Integer)session.getAttribute("auth");
	auth= IAuth.intValue();
	System.out.println("===Authentication=="+auth);

}
if(auth!=2){%><h3 align=center><br><br><br>You are not authorised User <br><br><A onclick="alert('Please register to view jobseekers details');window.opener.location.href='EmployRegistration0.jsp';window.close();" target="ResultFrame" ><img border="0"
	name="EmpReg" src="Images/EmployerRegistration0.jpg" width="140" height="28" onmouseover="document['EmpReg'].src='Images/EmployerRegistration1.jpg'" onmouseout="document['EmpReg'].src='Images/EmployerRegistration0.jpg'" ></a>
</h3><%}
else{
%>
<HEAD>

           
	<script LANGUAGE="Javascript" SRC="Images/validate.js"></script>

	
	<LINK href="styles.css" type="text/css" rel="stylesheet">

</HEAD>
<BODY class=Grad>

<h2 align=center>Details of <%=userid%></h2>
<FORM Name="ApplyJobForm">
<%

	Connection con=null;
	ResultSet rs=null,rs1=null,rs2=null;
	Statement stmt=null,stmt1=null,stmt2=null;
	try{
			
	/* Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	con = DriverManager.getConnection("jdbc:odbc:JobPortal","root",""); */


			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jobmiller","root","root");


			stmt =  con.createStatement();
			String Query = "Select * from educationaldetails where userid='"+userid+"'";
			System.out.println(Query);
			rs = stmt.executeQuery(Query);
			stmt1 =  con.createStatement();
			String Query1 = "Select * from contactinformation where userid='"+userid+"'";
			rs1 = stmt1.executeQuery(Query1);
			System.out.println(Query1);
			stmt2 =  con.createStatement();
			String Query2 = "Select * from professionalinformation where userid='"+userid+"'";
			rs2 = stmt2.executeQuery(Query2);
			System.out.println(Query2);

			
			}
			catch(Exception e){
			%><%=e%><%
		}
			

	
if(rs1!=null)
{
			%>
	<!--Displaying the table header-->

	<br>
<!--	<DIV STYLE="overflow:scroll;width:650px; height:400px;">-->

	
<%
int DisRow1=0;
			while(rs1.next())
			{
						String	FirstName			=rs1.getString(3);
						String	LastName			=rs1.getString(4);
						String	Email				=rs1.getString(5);
						String	ContactNumber		=rs1.getString(6);
						String  CurrentLocation		=rs1.getString(7);
						String  Address				=rs1.getString(8);
				DisRow1++;
					%>

				<table align=center border=0  width="60%">
				<TR class="row_title">
				<Td align=center colspan=2> Contact Information<BR></Td>
				</TR>
				 <tr><td align=Left style="background-color:#82C0FF" width="50%"><b>FirstName</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=FirstName%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF" ><b>LastName</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=LastName%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF" ><b>Email</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=Email%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF"><b>ContactNumber</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=ContactNumber%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF"><b>CurrentLocation</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=CurrentLocation%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF"><b>Address</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=Address%></font></td></tr>
				 
			
					</tr>
					</table>	

	

	<%
		}
if(rs!=null)
{
			%>
	<!--Displaying the table header-->

	<br>
<!--	<DIV STYLE="overflow:scroll;width:650px; height:400px;">-->

	
<%
int DisRow=0;
			while(rs.next())
			{
				 userid=rs.getString(2);
				 String	BasicQualification	=rs.getString(3);
						String	PercentageBQ	=rs.getString(4);
						String  YearOfPassBQ    =rs.getString(5);
						String  UniversityBQ   =rs.getString(6);
						String	PostGraduation	=rs.getString(7);
						String	Percentage		=rs.getString(8);
						String  YearOfPass    =rs.getString(9);
						String  University  =rs.getString(10);

				DisRow++;
					%>

				<table align=center border=0  width="60%">
				<TR class="row_title">
				<Td align=center  colspan=2> Educational Details<BR></Td>
				</TR>
				 <tr><td align=Left style="background-color:#82C0FF" width="50%"><b>BasicQualification</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=BasicQualification%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF" ><b>Percentage</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=PercentageBQ%></font></td></tr>
				<tr><td align=Left style="background-color:#82C0FF" ><b>YearOfPass</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=YearOfPassBQ%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF" ><b>University</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=UniversityBQ%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF" ><b>PostGraduation</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=PostGraduation%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF"><b>Percentage</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=Percentage%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF" ><b>YearOfPass</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=YearOfPass%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF" ><b>University</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=University%></font></td></tr>
				
			
					</tr>
					</table>	

	<%
	}
if(rs2!=null)
{
			%>
	<!--Displaying the table header-->

	<br>
<!--	<DIV STYLE="overflow:scroll;width:650px; height:400px;">-->

	
<%
int DisRow2=0;
			while(rs2.next())
			{
						String	TotalExperience	=rs2.getString(3);
						String	AnnualSalary	=rs2.getString(4);
						String  FunctionalArea    =rs2.getString(5);
						String  CompanyName   =rs2.getString(6);
						String	KeySkills	=rs2.getString(7);
						String	ResumeTitle		=rs2.getString(8);
						String	ResumePath		=rs2.getString(9);
						String  TextResume    =rs2.getString(10);
	String Location = application.getRealPath(request.getServletPath());
	String dirpath = Location.substring(0,Location.lastIndexOf("\\"));
	String DownloadsPath = dirpath+"/Downloads/"+"/Resumes/";

				DisRow++;
					%>

				<table align=center border=0  width="60%">
				<TR class="row_title">
				<Td align=center  colspan=2> Professional Information <BR></Td>
				</TR>
				 <tr><td align=Left style="background-color:#82C0FF" width="50%"><b>TotalExperience</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=TotalExperience%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF" ><b>Annual Salary</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=AnnualSalary%></font></td></tr>
				<tr><td align=Left style="background-color:#82C0FF" ><b>Functional Area</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=FunctionalArea%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF" ><b>Company Name</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=CompanyName%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF" ><b>Key Skills</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=KeySkills%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF"><b>ResumeTitle</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=ResumeTitle%></font></td></tr>
				 <tr><td align=Left style="background-color:#82C0FF"><b>TextResume</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=TextResume%></font></td></tr>
				<tr><td align=Left style="background-color:#82C0FF"><b>ResumePath</b></td>
				 <td align=Left style="background-color:#E1E1E1" title='Click here to download resume'><font  color="black"></font>
				 <A HREF="FileDownloads.jsp?fileName=<%=DownloadsPath+"//"+ResumePath%>" ><U><B><%=ResumePath%></B></U></A></td>
				</tr>
				<tr><td align=center colspan=2><INPUT TYPE="Button" Class="Button" Value="Close" onclick="window.close()"></td>
				</tr>
				</table>	

	<%
	}
	rs.close();

	rs1.close();
    rs2.close();
	if(DisRow1==0)
{
	/*To write to the server if the resultset is null*/
	%>
		<CENTER>
			<tr><th colspan=6>No Records found</th></tr>
		</CENTER>
	<%}
}
}
	}
%>


</table>

</FORM>
</BODY>
</HTML>
<%
}
%>
